<!DOCTYPE html>
<html>

	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>扫码取纸_进入</title>
		<link rel="stylesheet" href="../../css/mui.min.css">
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/vue.min.js"></script>
		<style>
			html,
			body {
				background-color: #fff !important;
			}
			*{
				padding: 0;
				margin: 0;
			}

			.mui-bar-nav {
				background: #fff;
				box-shadow: none;
			}

			.mui-icon-left-nav {
				color: #60C68B;
			}
			
			.container_box{
				padding: 10px;
				margin-top: 100px;
			}
			.container_box span{
				display: block;
				margin: 10px 0;
				color: #fff;
				width: 100%;
				height: 40px;
				line-height: 40px;
				text-align: center;
				background: #60C68B;
				border-radius: 20px;
			}

			
		</style>
	</head>

	<body>
		<div id="app" class="takepaper">
			<header id="header" class="mui-bar mui-bar-nav">
				<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
				<h1 class="mui-title">扫码取纸</h1>
			</header>
			<div class="container_box">
				<span @click="Open_weixin">打开微信</span>
				<span @click="Open_zhifubao">打开支付宝</span>
				<span @click="Open_QQ">打开QQ客服端</span>
			</div>
		</div>
		<script src="../../js/vue-resource.js"></script>
		<script src="../../js/base.js"></script>
		<script>
			mui.plusReady(function() {
				var current_window = plus.webview.currentWebview();

				var vm = new Vue({
					el: '#app',
					data: {
						result:current_window.url,
						
					},
					methods: {
						Open_weixin() {//用来打开微信 第三方程序   plus.runtime.launchApplication   参数pname  是包名的意思;  com.tencent.mm 是微信包名
							
								if (plus.os.name == "Android") {
									plus.runtime.launchApplication({
										pname: "com.tencent.mm",
									}, function(e) {
										plus.nativeUI.confirm("检查到您未安装\"微信\"，是否到商城搜索下载？", function(i) {
											if (i.index == 0) {
												androidMarket("com.tencent.mm");
											}
										});
									});
								} else if (plus.os.name == "iOS") {
									plus.runtime.launchApplication({
										action: "weixin://RnUbAwvEilb1rU9g9yBU"
									}, function(e) {
										plus.nativeUI.confirm("检查到您未安装\"微信\"，是否到商城搜索下载？", function(i) {
											if (i.index == 0) {
												iosAppstore("itunes.apple.com/cn/app/wechat/id414478124?mt=8");
											}
										});
									});
								}
								 
						},
						Open_zhifubao() {//用来打开微信 第三方程序   plus.runtime.launchApplication   参数pname  是包名的意思;  com.tencent.mm 是微信包名
							
								if (plus.os.name == "Android") {
									plus.runtime.launchApplication({
										pname: "com.eg.android.AlipayGphone",
									}, function(e) {
										plus.nativeUI.confirm("检查到您未安装\"支付宝\"，是否到商城搜索下载？", function(i) {
											if (i.index == 0) {
												androidMarket("com.eg.android.AlipayGphone");
											}
										});
									});
								} 
								 
						},
						Open_QQ() {//用来打开微信 第三方程序   plus.runtime.launchApplication   参数pname  是包名的意思;  com.tencent.mm 是微信包名
							
								if (plus.os.name == "Android") {
									plus.runtime.launchApplication({
										pname: "com.tencent.mobileqq",
									}, function(e) {
										plus.nativeUI.confirm("检查到您未安装\"QQ\"，是否到商城搜索下载？", function(i) {
											if (i.index == 0) {
												androidMarket("com.tencent.mobileqq");
											}
										});
									});
								} 
								 
						}
						
					},
					created(){
						var that=this;
						function createList() {
							var currentWindow = plus.webview.currentWebview(),
								//地址 ， id名:
								wsub = plus.webview.create(that.result, 'result', {
									top:'45px', 
									bottom: '0',
									width: '100%',
									height:'40px',
									position: 'absolute',
									scrollIndicator: 'none',
									zindex: '11',
									background: 'transparent'
								});
							currentWindow.append(wsub); 
						}
						createList();
						
						takepaper = plus.webview.getWebviewById('takepaper'),
						setTimeout(function() {
							plus.webview.close(takepaper);
						}, 1000);
					}
				})
				
				
				
				
			})
		</script>
	</body>

</html>
